//
//  HXGlobalFunc.m
//  HXTClient
//
//  Created by lemon on 14-3-29.
//  Copyright (c) 2014年 easaa. All rights reserved.
//

#import "HXGlobalFunc.h"

float HXOSVersion()
{
    return [[[UIDevice currentDevice] systemVersion] floatValue];
}

BOOL ArrayIsEmpty(NSArray *array)
{
    if (!(array != nil && ((NSNull *)array) != [NSNull null] && array.count > 0))
        return YES;
    return NO;
}

BOOL StringIsEmpty(NSString *str)
{
    if (!(str != nil && ((NSNull *)str) != [NSNull null] && str.length > 0))
        return YES;
    return NO;
}

BOOL DictionaryIsEmpty(NSDictionary *dic)
{
    if (!(dic != nil && ((NSNull *)dic) != [NSNull null] && dic.count > 0))
        return YES;
    return NO;
}

BOOL ObjectIsValid(id object)
{
    if ((object != nil && ((NSNull *)object) != [NSNull null]))
        return YES;
    return NO;
}

BOOL CurrentDeviceIsSupportedCallIPhone()
{
    UIDevice *currentDevice = [UIDevice currentDevice];
    NSString *strModel = currentDevice.model;
    if (![strModel isEqualToString:@"iPhone"])
        return NO;
    return YES;
}